﻿using UnityEngine;
using System.Collections;

public class PlayerFight : MonoBehaviour 
{
	public GameObject camera;
	float health;
	// Use this for initialization
	void Start () 
	{
		health = camera.GetComponent<Hud>().health;
	}
	
	// Update is called once per frame
	void Update () 
	{

		camera.GetComponent<Hud>().health = health;
	}
	void OnCollisionEnter2D(Collision2D other)
	{
		if(other.gameObject.tag == "Inimigo1")
		{
			health -= 30;
		}
	}

}
